package com.service.impl;

import com.dao.BaseDao;
import com.dao.impl.UserDaoImpl;
import com.entity.User;
import com.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements BaseService<User>{

    @Autowired
    BaseDao<User> userDao;

    public int selectByName(String name,String password){
        UserDaoImpl userdao= (UserDaoImpl) userDao;
        return userdao.selectByName(name,password);
    }

    @Override
    public List<User> selectAll() {
        return userDao.selectAll();
    }

    @Override
    public User selectById(String id) {
        return userDao.selectById(id);
    }

    @Override
    public boolean insert(User user) {
        return userDao.insertUser(user);
    }

    @Override
    public boolean deleteById(String id) {
        return userDao.deleteById(id);
    }

    @Override
    public boolean update(User user) {
        return userDao.update(user);
    }
}
